<!DOCTYPE html>
<html>
<head>
    <!-- 页面meta -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>疫情数据填报监控</title>
    <meta name="description" content="疫情数据填报监控">
    <meta name="keywords" content="疫情数据填报监控">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
    <!-- 引入样式 -->
    <link rel="stylesheet" href="../static/plugins/elementui/index.css">
    <link rel="stylesheet" href="../static/plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../static/css/style.css">
    <script src="../static/plugins/echarts/echarts.js"></script>
</head>
<body class="hold-transition">
<div id="app">
    <div class="content-header">
        <h1>统计分析<small>历史数据趋势</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>统计分析</el-breadcrumb-item>
            <el-breadcrumb-item>历史数据趋势</el-breadcrumb-item>
        </el-breadcrumb>
    </div>
    <div class="app-container">
        <div class="box">
            <el-container>
                <el-main>
                    <!-- 为 ECharts 准备一个具备大小（宽高）的 DOM -->
                    <div id="chart1" style="height:300px;background:#ecf0f5"></div>
                    <div id="chart2" style="height:300px;background:#ffffff"></div>
                </el-main>
                <el-aside width="50%">
                    <div id="chart3" style="height:310px;"></div>
                    <div id="chart4" style="height:300px;background:#ecf0f5;margin-top: 10px"></div>
                </el-aside>
            </el-container>
        </div>
    </div>
</div>
</body>
<!-- 引入组件库 -->
<script src="../static/js/vue.js"></script>
<script src="../static/plugins/elementui/index.js"></script>
<script type="text/javascript" src="../static/js/jquery.min.js"></script>
<script src="../static/js/axios-0.18.0.js"></script>
<script type="text/javascript">
    var vue = new Vue({
            el: '#app',
            data: {
                queryString: null,//查询条件
                dataList: [],//当前页要展示的分页列表数据
                formData: {},//表单数据
                dialogFormVisible: false,//增加表单是否可见
                dialogFormVisible4Edit: false,//编辑表单是否可见
            },
            //钩子函数，VUE对象初始化完成后自动执行
            created() {
                this.clickfind();
            },
            methods: {
                clickfind() {
                    axios.get("/l1").then((res) => {
                        var myChart1 = echarts.init(document.getElementById('chart1'));
                        var myChart2 = echarts.init(document.getElementById('chart2'));
                        var myChart3 = echarts.init(document.getElementById('chart3'));
                        var myChart4 = echarts.init(document.getElementById('chart4'));
                        var ec_right1_option = {
                            tooltip: {
                                trigger: 'axis',
                                //指示器
                                axisPointer: {
                                    type: 'line',
                                    lineStyle: {
                                        color: '#7171C6'
                                    }
                                },
                            },
                            legend: {
                                data: '新增确诊',
                                left: "right"
                            },
                            //标题样式
                            title: {
                                text: "新增确诊趋势",
                                textStyle: {
                                    color: 'black',
                                },
                                left: 'left'
                            },
                            grid: {
                                left: '3%',
                                right: '3%',
                                bottom: '3%',
                                top: 50,
                                containLabel: true
                            },
                            xAxis: [{
                                type: 'category',
                                //x轴坐标点开始与结束点位置都不在最边缘
                                // boundaryGap : true,
                                data: res.data.day
                            }],
                            yAxis: [{
                                type: 'value',
                                //y轴线设置显示
                                axisLine: {
                                    show: true,
                                },
                                axisLabel: {
                                    show: true,
                                    color: 'black',
                                    fontSize: 12,
                                    formatter: function (value) {
                                        if (value >= 1000) {
                                            value = value / 10000 + 'k';
                                        }
                                        return value;
                                    }
                                },
                                //与x轴平行的线样式
                                splitLine: {
                                    show: true,
                                    lineStyle: {
                                        // color: '#FFF',
                                        width: 1,
                                        // type: 'solid',
                                    }
                                }
                            }],
                            series: [{
                                name: "新增确诊",
                                type: 'line',
                                smooth: true,
                                data: res.data.confirm_add
                            }]
                        };
                        var ec_right2_option = {
                            tooltip: {
                                trigger: 'axis',
                                //指示器
                                axisPointer: {
                                    type: 'line',
                                    lineStyle: {
                                        color: '#7171C6'
                                    }
                                },
                            },
                            legend: {
                                data: '新增疑似',
                                left: "right"
                            },
                            //标题样式
                            title: {
                                text: "新增疑似趋势",
                                textStyle: {
                                    color: 'black',
                                },
                                left: 'left'
                            },
                            //图形位置
                            grid: {
                                left: '3%',
                                right: '3%',
                                bottom: '3%',
                                top: 50,
                                containLabel: true
                            },
                            xAxis: [{
                                type: 'category',
                                //x轴坐标点开始与结束点位置都不在最边缘
                                // boundaryGap : true,
                                data: res.data.day
                            }],
                            yAxis: [{
                                type: 'value',
                                //y轴线设置显示
                                axisLine: {
                                    show: true,
                                },
                                axisLabel: {
                                    show: true,
                                    color: 'black',
                                    fontSize: 12,
                                    formatter: function (value) {
                                        if (value >= 1000) {
                                            value = value / 1000 + 'k';
                                        }
                                        return value;
                                    }
                                },
                                //与x轴平行的线样式
                                splitLine: {
                                    show: true,
                                    lineStyle: {
                                        // color: '#FFF',
                                        width: 1,
                                        // type: 'solid',
                                    }
                                }
                            }],
                            series: [{
                                name: "新增疑似",
                                type: 'line',
                                smooth: true,
                                data: res.data.suspect_add
                            }]
                        };

                        var ec_right3_option = {
                            tooltip: {
                                trigger: 'axis',
                                //指示器
                                axisPointer: {
                                    type: 'line',
                                    lineStyle: {
                                        color: '#7171C6'
                                    }
                                },
                            },
                            legend: {
                                data: '新增治愈',
                                left: "right"
                            },
                            //标题样式
                            title: {
                                text: "新增治愈趋势",
                                textStyle: {
                                    color: 'black',
                                },
                                left: 'left'
                            },
                            //图形位置
                            grid: {
                                left: '3%',
                                right: '3%',
                                bottom: '3%',
                                top: 50,
                                containLabel: true
                            },
                            xAxis: [{
                                type: 'category',
                                //x轴坐标点开始与结束点位置都不在最边缘
                                // boundaryGap : true,
                                data: res.data.day
                            }],
                            yAxis: [{
                                type: 'value',
                                //y轴线设置显示
                                axisLine: {
                                    show: true,
                                },
                                axisLabel: {
                                    show: true,
                                    color: 'black',
                                    fontSize: 12,
                                    formatter: function (value) {
                                        if (value >= 1000) {
                                            value = value / 1000 + 'k';
                                        }
                                        return value;
                                    }
                                },
                                //与x轴平行的线样式
                                splitLine: {
                                    show: true,
                                    lineStyle: {
                                        // color: '#FFF',
                                        width: 1,
                                        // type: 'solid',
                                    }
                                }
                            }],
                            series: [{
                                name: "新增治愈",
                                type: 'line',
                                smooth: true,
                                data: res.data.heal_add
                            }]
                        };

                        var ec_right4_option = {
                            tooltip: {
                                trigger: 'axis',
                                //指示器
                                axisPointer: {
                                    type: 'line',
                                    lineStyle: {
                                        color: '#7171C6'
                                    }
                                },
                            },
                            legend: {
                                data: '新增死亡',
                                left: "right"
                            },
                            //标题样式
                            title: {
                                text: "新增死亡趋势",
                                textStyle: {
                                    color: 'black',
                                },
                                left: 'left'
                            },
                            //图形位置
                            grid: {
                                left: '3%',
                                right: '3%',
                                bottom: '3%',
                                top: 50,
                                containLabel: true
                            },
                            xAxis: [{
                                type: 'category',
                                //x轴坐标点开始与结束点位置都不在最边缘
                                // boundaryGap : true,
                                data: res.data.day
                            }],
                            yAxis: [{
                                type: 'value',
                                //y轴线设置显示
                                axisLine: {
                                    show: true,
                                },
                                axisLabel: {
                                    show: true,
                                    color: 'black',
                                    fontSize: 12,
                                    formatter: function (value) {
                                        if (value >= 1000) {
                                            value = value / 1000 + 'k';
                                        }
                                        return value;
                                    }
                                },
                                //与x轴平行的线样式
                                splitLine: {
                                    show: true,
                                    lineStyle: {
                                        // color: '#FFF',
                                        width: 1,
                                        // type: 'solid',
                                    }
                                }
                            }],
                            series: [{
                                name: "新增死亡",
                                type: 'line',
                                smooth: true,
                                data: res.data.dead_add
                            }]
                        };
                        myChart1.setOption(ec_right1_option)
                        myChart2.setOption(ec_right2_option)
                        myChart3.setOption(ec_right3_option)
                        myChart4.setOption(ec_right4_option)
                    });
                }
            }
        })
    ;
</script>
</html>
